import apibase from "@/api/apiBase";
import axios from "axios";
import { attrAddInterface, attrEditInterface, attrDelInterface, attrValuesInterface, cacheClearInterface } from "./systemConfiguration.interface";
//获取险种属性列表
export const $insuranceAttrList = () => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.get({
    url: '/travel/attr/getList',
    data: {},
    instance,
  });
}
//添加险种属性
export const $attrAdd = (params: attrAddInterface) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.post({
    url: '/travel/attr/add',
    data: params,
    instance,
  });
}
//编辑险种属性
export const $attrEdit = (params: attrEditInterface) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.post({
    url: '/travel/attr/edit',
    data: params,
    instance,
  });
}
//删除险种属性
export const $attrDel = (params: attrDelInterface) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.post({
    url: '/travel/attr/del',
    data: params,
    instance,
  });
}
//获取险种属性配置详情
export const $attrValues = (params: attrValuesInterface) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.get({
    url: '/travel/insurance/getAttrValues',
    data: params,
    instance,
  });
}
//缓存类型列表
export const $cacheList = () => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.get({
    url: '/travel/cache/list',
    data: {},
    instance,
  });
}

//清除数据缓存
export const $cacheClearData = () => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.post({
    url: '/travel/cache/clearData',
    data: {},
    instance,
  });
}

//数据缓存标签列表
export const $cacheTagList = () => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.get({
    url: '/travel/cache/tagList',
    data: {},
    instance,
  });
}

//删除标签缓存
export const $cacheClear = (params:cacheClearInterface) => {
  const $server = new apibase();
  const instance = axios.create();
  return $server.post({
    url: '/travel/cache/clear',
    data: params,
    instance,
  });
}